Hey,
I want to save data from a gallery from outside the gallery.
Please see the picture on the right.
I want to save the Textinput and the number on the right (61, 62...).
To achive this I tried the following statement:
ForAll(Gallery2.AllItems, Collect( tempCollection, { CheckOrderLineId: Gallery2.AllItems.CheckOrderLineId, ActualData : Gallery2.AllItems.TextInput3 } ) );
But the data is stored not as I want.
Powerapps saved all Textinputs and numbers in every row.
Thanks for your help
Jonas
Solved! Go to Solution.
Hi @JonasH ,
Do you want to save your Gallery Items data into a collection?
Based on the formula you provided, I think there is something wrong with it. Please consider modify your formula as below:
Clear(tempCollection); /* <-- Add this formula to get rid of duplicated records in this tempCollection */
ForAll(
Gallery2.AllItems, Collect( tempCollection, { CheckOrderLineId: ID, ActualData : TextInput3.Text } ) );
or
Clear(tempCollection); /* <-- Add this formula to get rid of duplicated records in this tempCollection */
ForAll( Gallery2.AllItems, Collect( tempCollection, { CheckOrderLineId: Value(IDLabel.Text), ActualData : TextInput3.Text } ) );
Please consider take a try with above solution, check if the issue is solved.
Best regards,
Looking at your code I can see you are saving the entire column to the collection. The code Gallery2.AllItems.your_field saves a single column table.
ForAll(Gallery2.AllItems, Collect( tempCollection, { CheckOrderLineId: Gallery2.AllItems.CheckOrderLineId, ActualData : Gallery2.AllItems.TextInput3 } ) );
To save only the current item try this instead
ForAll(Gallery2.AllItems, Collect( tempCollection, { CheckOrderLineId: Gallery2[@CheckOrderLineId], ActualData : TextInput3.Text } ) );
Let me know if there are any questions
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Hey @mdevaney
thanks for your help.
Meanwhile the "CheckOrderLineId" changed to "ID" but the adjusted code doesnt work.
ForAll(Gallery2.AllItems,
Collect(
tempCollection,
{
CheckOrderLineId: Gallery2[@ID],
ActualData : TextInput3.Text
}
)
);

I may be to stupid momentarily, please excuse.
I will be able to reply in about 2 days
Have a nice weekend
Jonas
Before you go can you try these instead and let me know the result? I was trying to use Gallery2[@ID] in case Gallery2.AllItems and tempCollection both had an ID column. Perhaps my snytax was wrong.
ForAll(Gallery2.AllItems, Collect( tempCollection, { CheckOrderLineId: Gallery2.ID, ActualData : TextInput3.Text } ) );
ForAll(Gallery2.AllItems, Collect( tempCollection, { CheckOrderLineId: ID, ActualData : TextInput3.Text } ) );
Hi @JonasH ,
Do you want to save your Gallery Items data into a collection?
Based on the formula you provided, I think there is something wrong with it. Please consider modify your formula as below:
Clear(tempCollection); /* <-- Add this formula to get rid of duplicated records in this tempCollection */
ForAll(
Gallery2.AllItems, Collect( tempCollection, { CheckOrderLineId: ID, ActualData : TextInput3.Text } ) );
or
Clear(tempCollection); /* <-- Add this formula to get rid of duplicated records in this tempCollection */
ForAll( Gallery2.AllItems, Collect( tempCollection, { CheckOrderLineId: Value(IDLabel.Text), ActualData : TextInput3.Text } ) );
Please consider take a try with above solution, check if the issue is solved.
Best regards,
Thanks for your helpfull replys.
Your solutions worked well.
I used the code below (dont be confused cause of other line names):
Clear(tempCollection); ForAll(Gallery2.AllItems, Collect( tempCollection, { ID: ID, measuredSize: Value(TextInput3.Text) } ) );
My next step is to update the measuredSize to a SQL record with the correspond ID.
Thanks for your help.
Have a nice day ^-^
Jonas
I have another question.
To save the data in a collection was just a bypass of saving the data in an SQL table.
I thought it might be easier to save the data in a collection before updating a SQL table column with the specific ID.
Unfortunately it only work with a hardcoded ID.
Please take a look on the code below:
UpdateIf('[qc365].[W_InspectionTaskPosition]', ID = 87, {measuredSize: Value(TextInput3.Text)})
The best result is, to get the current ID of a Forall statement.
I also tried to get the data from the collection (remember the bypass).
Thanks for your help.
Jonas
You might want to close this thread and post as a new question so others will take a look. I don't know the answer here.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
204 | |
180 | |
62 | |
32 | |
30 |
User | Count |
---|---|
324 | |
270 | |
104 | |
74 | |
56 |