web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Path collection data w...
Power Apps
Answered

Path collection data with a dropdown value

(1) ShareShare
ReportReport
Posted on by 142
Hi all,
 
this should be an easy one. I have simple collection from a galllery (column with Names, IDs, Date and a text value from dropdown).
 
This is the code:
 
ForAll(colPlan As plan;
    Patch(DelnikPrescasy;
        Defaults(DelnikPrescasy);
            {
                KdoID: plan.crf13_id;
                Kde: plan.drpTextP;
                Kdo: plan.crf13_jmeno;
                Kdy: datPlan.SelectedDate;
                Hotovo: false  
            }
    )
);;
 
 
Makes no alerts on errors first, but get back with runtime error when launched (see picture).
 
The problem is dropdown control obviously. In gallery I am transferring the value to a label:
Text(drpPlan.Selected.Soupis)
 and in Patch I am taking text from that label, but both columns in collection consists this: Control element - undefined
 
I cant see why there is no actual value from a dropdown in collection.
Thank you
Categories:
I have the same question (0)
  • JM-14081323-0 Profile Picture
    142 on at
    There is a picture
    6.png
  • Verified answer
    WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    Assuming that Kde is a Text field and drpTextP is your Label in the gallery, you may need this
    ForAll(
       colPlan As plan;
       Patch(
          DelnikPrescasy;
          Defaults(DelnikPrescasy);
          {
             KdoID: plan.crf13_id;
             Kde: plan.drpTextP.Text;
             Kdo: plan.crf13_jmeno;
             Kdy: datPlan.SelectedDate;
             Hotovo: false  
          }
       )
    );;
    You may also be able to do it a lot more efficiently like this
    Patch(
       DelnikPrescasy;
       ForAll(
          colPlan As plan;
          {
             KdoID: plan.crf13_id;
             Kde: plan.drpTextP.Text;
             Kdo: plan.crf13_jmeno;
             Kdy: datPlan.SelectedDate;
             Hotovo: false  
          }
       )
    );;
    ForAll is not designed to be a loop, although it can act that way if it contains an action inside it. ForAll creates a Table, which can be Patched in one action to the data source and will run much faster than individual Patches for each record. 
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard