Variables & Collections | HOW to use Microsoft POWER APPS (2024)

Поділитися
Вставка
  • Опубліковано 7 лип 2024
  • In the third episode of this BEGINNER training course on how to use Microsoft POWER APPS, we will deep dive into the app's internal memory! Variables, Collections...and much more, check it out!
    In the other videos in this playlist we will tackle more Powerapps building blocks:
    ✅ Creating the App within a Solution
    ✅ Screen Navigation
    ✅ Galleries & Data sources (Sharepoint!)
    ✅ Forms
    ✅ Overlays & Pop-ups
    ✅ ...and so much more!
    💻 Developing on a low code platform is so much fun, so join us for the ride! Use these videos as a tutorial to build and develop your own apps! Keep us posted in the comments!
    🎥 Link to the whole playlist:
    • HOW to use Power Apps ...
    📚 VIDEO CHAPTERS:
    0:00 Introduction
    0:52 Local & Global VARIABLES
    13:07 COLLECTIONS as a Data Source
    17:52 CUSTOM Collections
    20:04 TEASER for next video!
    ▶️ Official Microsoft guide for Powerapps formulas:
    learn.microsoft.com/en-us/pow...
    📜Check out the Cegeka website on the Power Platform:
    www.cegeka.com/en/be/solution...
    ❇️ If you like this kind of content and want to see more, don't forget to:
    - Smash that LIKE button! 👍
    - Leave a COMMENT with your questions and remarks! ✏️
    - SUBSCRIBE to our channel! 🔴
    👀 Stay tuned for upcoming videos on the Power Platform and MS D365!
    🗣 Also feel free to leave some ideas for future videos in the comment section down below!
    -- SETUP FOR THE SHAREPOINT SITE --
    Create a Sharepoint-site called "OfficeOrderingSite" and make sure that your user (the one where you are developing the PowerApp with) also has read & write permissions on this whole site.
    On that site create these 3 lists, these are used throughout the video series:
    "Categories" (these are all required fields!)
    - Title = default Sharepoint-field (will serve as the category name)
    - CategoryID = number field
    - CategoryImage = image field (I used 250x250 jpg-images, but feel free to choose your own!)
    "Items" (these are all required fields!)
    - Title = default Sharepoint-field (will serve as the item name)
    - ItemID = number field
    - CategoryID = number field
    - ItemPrice = currency field
    - ItemImage = Image field (I used 250x250 jpg-images, but feel free to choose your own!)
    "OrderHeader" (these are all required fields, except for "Notes"!)
    - ID = default Sharepoint-field
    - Email = default Title-field renamed to "Email"
    - Orderer = required single line of text field
    - OrderDate = required single line of text field
    - Notes = not-required multiple lines of text field
    - TotalAmount = required currency field
    - NumberOfItems = required number field
    - Status = required Choice-field (with options: Ordered, Approved, Rejected, NeedsApproval)
    For the 3 images used in the app itself, you can also choose whatever images you like!
  • Наука та технологія

КОМЕНТАРІ • 67

  • @CegekaBusinessSolutions
    @CegekaBusinessSolutions  Рік тому +3

    Still unclear what variables and collections are? Let us know down in the comments! Feel free to contact us at www.cegeka.com/en/be/solutions/dynamics365/contact !

  • @louiscote-sansfacon4051
    @louiscote-sansfacon4051 День тому

    Wow, you are such a good teacher! Out of all the tutorials I've searched, you are by far the most comprehensive and easy to follow. Great series too. The way you show how to do things, but not only that, the way you explain why you do them, really helps us understand what we can also do. I'm sure I will be able to navigate Power Apps by myself after your series :). I will definitely look for your other tutorials. Great work and keep publishing that great content!

  • @nextlevel19966
    @nextlevel19966 4 місяці тому +1

    One of the best Instructors, who has the Intent and knowledge to make learning so valued

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  4 місяці тому +1

      Oh thanks, that a really nice thing to say! Glad you liked it! :-) - Jochen

  • @alsaukh3
    @alsaukh3 Рік тому +1

    By far, this series is the best👍 (Microsoft POWER APPS) tutorial I have found,
    Please, we need a lot more about it😊👋

  • @rafalbielinski203
    @rafalbielinski203 4 місяці тому +1

    Best tutorial I found so far :) Great work!

  • @mirrrvelll5164
    @mirrrvelll5164 11 місяців тому +3

    Hey! I enjoyed your series of PowerApps Beginner lessons, very good explained, actually so great that someone can start something alone! damn! I just started in my Company with PApps and this is definitely "must" =) you got a new follower with a bell icon =)

  • @Iamkehny
    @Iamkehny Рік тому +1

    Thank you so so much for this amazing tutorial.We need more please (Intermediate tutorial on Canvas apps) and Beginner Tutorial on Model Driven Apps are app Ideas. Also Power Automate Cloud and Power Automate Desktop

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  Рік тому +1

      Thank you for the kind words, much appreciated! We are working on more content, so thank you for the ideas! 😀

  • @hassanmarji6419
    @hassanmarji6419 11 місяців тому +2

    Guys sometimes for separating function calls you have to put a double semicolon. It depends on the region you currently are. As for me to make it work, I've to write it like this:
    ClearCollect(colItems; Items);;
    ClearCollect(colCategorie; Categories)
    Hope it helps!

  • @kadichidu4171
    @kadichidu4171 11 місяців тому +1

    Please complete this series as soon as possible

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  11 місяців тому +1

      Hi! Actually this series was completed the moment it was launched: ua-cam.com/play/PLdW2a9-HXy7F3bbQhb3E2uxG5NCAxHptU.html (5 episodes) More videos on different topics coming soon though, stay tuned! 👍😀

    • @kadichidu4171
      @kadichidu4171 11 місяців тому +1

      @@CegekaBusinessSolutions please make videos on all the important power fx functions

    • @kadichidu4171
      @kadichidu4171 11 місяців тому +1

      @@CegekaBusinessSolutions your teaching style is great..love from India keep up the great work

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  11 місяців тому +1

      Thanks! 👍😀

  • @stenjohannesson
    @stenjohannesson 9 місяців тому +1

    Great video, thanks!
    If i'm writeing an application for a browser, is there any major advantages to use collections, or could I just as well use online sources (like your lists)? Also, I have a dedicated Dataverse environment - any advantages/disadvantages using dataverse in stead of lists?

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  9 місяців тому +2

      Thanks! Collections are internal memories data structures, so performance wise they will always be better than external data connections. That being said, it really depends on your use case to decide when you would want to use either of them. Dataverse is better as a database, since it's actually build to be a database. I didn't use it because it requires a Premium connector license, while SharePoint is included in most standard MS Office licenses without extra costs. Hope this helps! - Jochen

  • @WhatkaCo
    @WhatkaCo Рік тому +2

    Hi Jochen, I am just playing with the tools and try to apply the logic with the basket to my case - I would like to make certain Image visible based on selected categoryID; however, my formula does not work: If(Category2, CategoryID=1, DisplayMode.Edit, DisplayMode.Disabled). Can you help, please? In the end I would like to have 3 images that would overlap each other based on selected categoryID. Thank you

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  Рік тому +1

      Hi! I would just add 1 Image-control outside of the Categories-gallery and for it's Image-property try: galCategories.Selected.ItemImage. That way the control will show an image based on which record is selected in the Categories gallery.
      If you want to keep the images inside of the gallery, but you only want to show the actual image for the selected category, do this: for the image-control inside of the Categories-gallery, set the Visible-property to ThisItem.IsSelected, that should do the trick because that formula results in "true" or "false" so it will determine if the image is visible or not. So you don't need the DisplayMode-property for this. 😎
      Hope this helps! - Jochen

  • @ziadjadaa6002
    @ziadjadaa6002 8 місяців тому +1

    Hi again Jochen @CegekaBusinessSolutions
    I'm having problems with creating the output collection with more data than you've demonstrated brilliantly.
    Any chance we can connect to discuss/view what I need extra and how to do it?
    Appreciate your amazing course!

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  8 місяців тому +1

      Hi, thanks for the kind words! I can't offer you a direct connect session, but maybe you can briefly explain what you want to do? Then I will try and help you here. - Jochen

  • @flyingc4pyb4r4
    @flyingc4pyb4r4 11 місяців тому +1

    hi! This series has helped me a lot btw :) just one thing i'd like to ask.... Is it possible to add a text input box for each item where a user can choose the qty they wish to order, instead of clicking "Order" multiple times?

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  10 місяців тому +1

      Hi! Sure, just add a text input control inside of the gallery's element, rename it to txtItemQty. You then also need to adjust the shopping basket collection of course, since I didn't use a Qty-field in there. So in the Order-button, it should be something like Collect(colShoppingBasket, {ItemName: ThisItem.ItemName, ..... , Qty: txtItemQty.Text}) Hope this helps! - Jochen👍

    • @amcrwa86
      @amcrwa86 9 місяців тому +1

      Hi! I'm trying to do the same thing and added the text input, but not sure where to change the name. I've changed the format to number. What category on the drop down on the formula bar should I be typing ThisItem.ItemQty? Or have I completely misunderstood what you started in the previous response?

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  9 місяців тому +1

      Hi! Change the name of the text input control in the tree view, so you can use that name in the Order-button's formula like I stated in my previous comment. You don't have to change any other properties of the text input control.

  • @martinholmberg1920
    @martinholmberg1920 Рік тому +1

    Hi! Great video! Can I add items to a collection via a form and not use a SharePoint site connection once it's "imported" to the app?

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  Рік тому +1

      Hi Martin, and thanks! 😀 No, unfortunately you can't use a Form with in-memory data sources like collections. Maybe check out this link for some more info on that: powerappsguide.com/blog/post/set-form-data-source-to-a-collection. Hope it helps!

  • @pjk6181
    @pjk6181 8 місяців тому +1

    Thank you so much for sharing such amazing skills. I followed one by one, and I made an app. Wow! But one problem I met is, the form that was made at the last step is not showing in preview and when playing the app. Do you have any idea to advise me ? Please 😂

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  8 місяців тому +1

      Good job, and thanks! 😀 On your question: check the "Default mode" property of your form, in the right side properties pane. It will most likely still be set to "Edit" for you, change that to "New". That, in combination with the NewForm(...) and ResetForm(...) functions in the video, should solve your problem. Hope this helps! - Jochen

  • @optimisesocialmedia
    @optimisesocialmedia 11 місяців тому +1

    Greats there a limit to number of records in a collection? If my original data source has 20k+ rows, would I want to pull it all to internal memory? I like the idea for a mobile app but am concerned about performance via phone network. Absolutely loving the series though. Great presentation and structure. Thank you 🙏

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  11 місяців тому +1

      Hi, and thanks! Yes, working with big data sources will require some workarounds to properly get your data into the internal memory's collections. It's not impossible, but will require some "creativity" and some tweaking to the app's performance. 👍 - Jochen

    • @optimisesocialmedia
      @optimisesocialmedia 11 місяців тому +1

      Hi Jochen, thanks for replying. After I watched the next video some of this was explained, so thanks for that. When you say “creative” solutions, would it make sense to , say, filter the data befor it is loaded into memory and add that to a collection? Eg. If the list were to be names! Perhaps group by letters , then load the specific group to memory at point of use?

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  11 місяців тому +1

      That is an option yes, or you can use Power Automate. In short:
      - you trigger a Power Automate flow from within the app, passing some parameters which are your filters
      - Power Automate fetches the correct records by using the filter parameters you passed
      - Power Automate returns the list of filtered records back to the app, where it's stored in a collection
      However, if the filtered record count is still bigger than 2000, this won't make any difference. In that case you might need to think about having multiple lists/groups like you said. Different approaches will be suited, depending on the data structure and record count.
      Hope this helps! - Jochen

  • @philippeco2670
    @philippeco2670 11 місяців тому +1

    Hello, thanks for yours videos.
    I have a question for you.
    Is it possible to use a variable in a collect function ?
    In my case I 5 five SharePoint's list and I want to create a single app who add/modify records in a list that I choose with a combox.
    I currently have a local collection and I want to update my SharePoint's lists.
    Thank you for your help.
    Regards.
    Philippe

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  11 місяців тому +1

      Hi Philippe! Well you can't use a collection directly as the datasource for a Form at this moment, but in the end you could use the Patch() function to update/create records in any SharePoint list with any values you like. Maybe this link could give you an idea: www.matthewdevaney.com/patch-multiple-records-in-power-apps-10x-faster/ Or just Google search "Powerapps patch" for more information on the function itself.
      If you want to use the combobox for dynamic visibility of the necessary fields that have to be filled for the chosen list, you can use the Combobox.Selected.Value in combination with the Visible-properties on the controls that need to be filled. So something like If(comboBox.Selected.Value = "list1", true, false) for that Visible-property should work.
      Hope this helps! - Jochen

    • @philippeco2670
      @philippeco2670 11 місяців тому +1

      @@CegekaBusinessSolutions Thank you for your prompt reply.
      But, it is not the answer I was looking for.
      In my case, the first argument in my "Patch" is a variable.
      I have 12 lists to update and I don't want to duplicate my code.
      I take a look for another solution : "One list with folders" (it's not easy either ;))
      But, thank you for your help.

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  11 місяців тому +1

      No worries! Yeah you can use variables in a Patch-function as well, no problem. Good luck! - Jochen

  • @gaelrobinson3640
    @gaelrobinson3640 9 місяців тому +1

    I'm learning a lot and following along but stumbled - when my data won't display

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  9 місяців тому +1

      Hi Gael! Does it not display after you filled the collections and started using those as the data source for your galleries? If you have put the ClearCollect()-code on the OnVisible-property for you Home Screen, be sure to trigger it as well. So after you have put the code in place, navigate away from the Home Screen and back to it, that will trigger the OnVisible-code and your collections should be filled at that point. After that you should see the data in the galleries when you go to the New Order Screen, if you have updated the Items-properties to colItems and colCategories. Hope this helps! - Jochen

  • @audreytucker27
    @audreytucker27 Рік тому +1

    This has been a great series for a first time user in Power Apps. How can I make my "select" button disable after 1 selection to my shopping basket? I tried replacing the > 0 with =1 and it would not work.

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  11 місяців тому +2

      Hi Audrey, thanks! Which button do you want to hide exactly, the "Order" button in the Items-gallery? If that is the case, you would have to check if that item is already in the shopping basket, which is somewhat more advanced but you could do something like this in the DisplayMode-property of that button: If(CountRows(Filter(colShoppingBasket, ItemID = ThisItem.ItemID)) > 0, DisplayMode.Disabled, DisplayMode.Edit). It's probably not the most performant/best way of doing it, but it's just an example. Hope this helps! - Jochen

    • @audreytucker27
      @audreytucker27 11 місяців тому +1

      @@CegekaBusinessSolutions I finally was able to disable the "Order" and "More Shopping" . Thanks!

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  11 місяців тому +1

      Nice! 👍

    • @gabrielavlad274
      @gabrielavlad274 Місяць тому +1

      @@CegekaBusinessSolutions hi, i struggle with the same...tried the above solution but keeps telling me that values being compared in my formula aren't the same type; could you please advise further?
      thanks

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  Місяць тому +1

      Hi Gabriel! Could you maybe copy paste the entire formula that is giving that error in here? Otherwise it will be hard to spot the issue I'm afraid. Thanks!

  • @essential021
    @essential021 10 місяців тому +1

    Dear Sir, when using "if " condition --> "If(varLocalItemCounter > 0, Edit, Disabled)" for "clear shopping basket button" i am getting error --> " the function if has some invalid arguments" . I am using powerapps MSDN version. i have tried my best to fix but unable to do so. Please help😞

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  9 місяців тому +2

      Hi! Try DisplayMode.Edit and DisplayMode.Disabled in the formula, instead of just Edit and Disabled. Microsoft changed that syntax after I created the videos... Hope this helps ! - Jochen

  • @janienreeves2813
    @janienreeves2813 Рік тому +1

    I'm able to follow along until you lost me. do you have a video on how to link the sharepoint to the app?

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  Рік тому +1

      Hi! Sure, it's the second video in this playlist. Link: ua-cam.com/video/ez2c4agBh0s/v-deo.html

  • @user-wz1xh8qq4p
    @user-wz1xh8qq4p Рік тому +1

    My Filter for different items is no longer working. How do I fix this.

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  Рік тому +1

      Hard to tell for sure where the error is, but I would:
      - check if your "colItems"-collection gets filled properly, so make sure that the items are actually in there
      - check your Items-property on that gallery, should be something like "Filter(colItems, CategoryID = galCategories.Selected.CategoryID)" (if you have named the Sharepoint-fields and controls in the same way like I did)
      Hope this helps! - Jochen

    • @hassanmarji6419
      @hassanmarji6419 11 місяців тому +1

      It happened the same thing with me. Some characters are no longer working so you have to write the formulas in a different manner.
      Filter(Items; CategoryID = galCategories_NOS.Selected.CategoryID)
      Most of the time for separating the parameters you have to put a semicolon

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  11 місяців тому +2

      The formula syntax can indeed vary based on your regional settings, so for example it can be that you have to replace "," with ";" and ";" with ";;". I have used "en-us" as the regional setting.
      More info here: learn.microsoft.com/en-us/power-platform/power-fx/global#formula-separators-and-chaining-operator
      And here: powerusers.microsoft.com/t5/Building-Power-Apps/Syntax-changes-according-to-language/m-p/503082#M153049
      Hope this helps! - Jochen

  • @RoyAliKhairan
    @RoyAliKhairan Рік тому +1

    Why do we need to copy external data to the internal? *curious

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  Рік тому +1

      Hi, good question! You don't "need" to do that, but it's just an example of how you could use a Collection in Powerapps really. The advantage here is that the "data refresh" moment is now limited to the OnVisible of the Home Screen, instead of having to reload data every time the galleries are shown to the user (because of the "live" connection they would have to SharePoint). Hope that makes sense!

    • @TheMKTube
      @TheMKTube Рік тому +1

      @@CegekaBusinessSolutions Thanks, and what would happen if it’s a large list? For example, I have a list with 60k items. Would it load as much as the set delegation limit or something?

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  Рік тому +1

      @@TheMKTube good question! PowerApps currently still has a max limit of 2000 records to load in directly from any external data source, when using a filter. The "delegation warning" you will get as a notification is all about that.
      There are workarounds to work with bigger amounts of data, for example you could use a Power Automate flow to fetch the data from the data source (with the correct filters applied) and pass it to the app. This has its own limits but they are less strict. The app then stores that data in a collection and you are good to go.
      Final note on this: it all starts with data optimisation! Keep your data lists as clean as possible. Records that are "done" can be periodically moved to another "archive"-list on SharePoint or whatever. Think about this to keep the number of data records as small as possible, your app's performance will also thank you! 😀
      Hope this helps! - Jochen

  • @monosijchakraborty4312
    @monosijchakraborty4312 3 місяці тому +1

    I am doing a project of advance ticketing app in power app.I have facing some problems.I need your help.Kindly provide your email address to contact with you.

    • @CegekaBusinessSolutions
      @CegekaBusinessSolutions  3 місяці тому +1

      Hi! Please use the contact form on our website to get in touch: www.cegeka.com/en/solutions/dynamics365/technology/power-platform . Thanks! - Jochen