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 / Get the Value as Strin...
Power Apps
Answered

Get the Value as String from ForAll function?

(1) ShareShare
ReportReport
Posted on by 26

I want to go into a collection where i store some scanned barcodes and read out (the only column in it).

Indipendet how much are in the collection i want to create a new forms submission to a SP list for every line in the collection.

 

Every Value of the Collection Rows sould be combined with Strings variables wich I get from an form input and than pass it all in a SP list record.

 

Works all fine but it wont give me the value from the collection (first line in forall loop).

Probably because the "Value"Variable from the ForAll Loop gives back a single line table? I tryed to make it with concat but it didnt work.

 

Name of the Collection: colBarcodes

Name of the Column in Collection: Value

 

On a Button OnSelect i got this code:

Set(varDataAbteilung; DataCardValueAbteilung.Text);;
Set(varDataEtage; DataCardValueEtage.Text);;
Set(varDataRaum; DataCardValueRaum.Text);;
Set(varDataNutzer; DataCardValueNutzer.Text);;
Set(varDataKST; DataCardValueKST.Text);;

ForAll(colBarcodes; 
 DataCardValueSYSID.Text = Concat(colBarcodes, Value);;
 DataCardValueAbteilung.Text = varDataAbteilung;;
 DataCardValueEtage.Text = varDataEtage;;
 DataCardValueRaum.Text = varDataRaum;;
 DataCardValueNutzer.Text = varDataNutzer;;
 DataCardValueKST.Text = varDataKST;;
 SubmitForm(Form_Erfassen))

 

Categories:
I have the same question (0)
  • Talha_Dar Profile Picture
    870 Super User 2024 Season 1 on at

    Hi @flowArcade,

     

    Try updating your "ForAll" as follows.

    ForAll(colBarcodes As currRecord; 
     DataCardValueSYSID.Text = Concat(colBarcodes, Value);;
     DataCardValueAbteilung.Text = varDataAbteilung;;
     DataCardValueEtage.Text = varDataEtage;;
     DataCardValueRaum.Text = varDataRaum;;
     DataCardValueNutzer.Text = varDataNutzer;;
     DataCardValueKST.Text = varDataKST;;
     SubmitForm(Form_Erfassen))

     

    If it shows some error add "currRecord" in front of all the fields like the following.

     

    DataCardValueAbteilung.Text = currRecord.varDataAbteilung;;

     

    If you found my answer helpful, please consider giving it a thumbs-up or a like. Your feedback is greatly appreciated!

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • flowArcade Profile Picture
    26 on at

    Thanks for your answer. Unfortunitly it still doesent do the thing with both variants. Isnt there a possiblility to work with a loop in power apps?

  • Talha_Dar Profile Picture
    870 Super User 2024 Season 1 on at

    Hi @flowArcade,

     

    Are you using the similar code and still getting error?

     

    ForAll(colBarcodes As currRecord; 
     DataCardValueSYSID.Text = Concat(currRecord.colBarcodes, Value);;
     DataCardValueAbteilung.Text = varDataAbteilung;;
     DataCardValueEtage.Text = varDataEtage;;
     DataCardValueRaum.Text = varDataRaum;;
     DataCardValueNutzer.Text = varDataNutzer;;
     DataCardValueKST.Text = varDataKST;;
     SubmitForm(Form_Erfassen))

     

    Assuming "currRecord" is a collection containing "currRecord" column of containing a table of values.

     

    If you found my answer helpful, please consider giving it a thumbs-up or a like. Your feedback is greatly appreciated!

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Verified answer
    poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @flowArcade 

    What you are doing there is not correct, the syntax SomeControl.Text = var... is not correct.

    Besides this you are terminating the parts inside your ForAll arbitrarily by using ;;
    Try like this instead:

    // Setting the variables from the form input
    Set(varDataAbteilung; DataCardValueAbteilung.Text);;
    Set(varDataEtage; DataCardValueEtage.Text);;
    Set(varDataRaum; DataCardValueRaum.Text);;
    Set(varDataNutzer; DataCardValueNutzer.Text);;
    Set(varDataKST; DataCardValueKST.Text);;
    
    // Creating a collection to hold the combined data
    ClearCollect(colCombinedData; ForAll(colBarcodes; {
     Barcode: Value;
     Abteilung: varDataAbteilung;
     Etage: varDataEtage;
     Raum: varDataRaum;
     Nutzer: varDataNutzer;
     KST: varDataKST
    }))
    

    See if this gets you going the right direction @flowArcade 

  • flowArcade Profile Picture
    26 on at

    Thanks a lot! This giving me a new perspective to solve the problem 

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard