Hello,
I have a gallery which is connected to a collection. Within the gallery, the user is able to re-arrange the items by clicking on the up or down button. by doing this, the "Order" field in the collection updates to whichever position the user has moved the item to.
There are 6 items in total. This is for a reorder question and the items have to be put in a specific order.
I am trying to write an if statement which would show me the following:
If collection (Reorder), Name field = "Beginning" and Order field = 1, and Name field = "Planning" and Order field = 2 and so on, this would be correct.
How would I write this in a text box?
thanks
Alistair
Solved! Go to Solution.
Sorry, forgot about the trailing semi-colon.
Formula should be:
If(
Concat(Gallery3.AllItems, Name & ";") = "Beginning;Planning;Preparation;Introduction;Main Ideas;Conclusion;",
"Correct", "Wrong"
)
@neill_long Could you pls share some screen shots & formulas that to have currently to understand your situation better.
Can you expand a little more on what role the Name field has in the order of your items? In general, it sounds like you are trying to provide a way to re-order the items in a list?
Please share a little more to help with this.
Hi @CNT & @RandyHayes
I was following this video by April Dunnan - https://www.youtube.com/watch?v=vuBuPxOY8uM
The gallery displays the items in a mixed up order:
On the Up arrow, I have the formula:
UpdateContext({previousRecord:LookUp(
Reorder,
Order = ThisItem.Order - 1)
});
Update(Reorder,
previousRecord,
{Name: previousRecord.Name,
Order: ThisItem.Order
}
);
Update(
Reorder,
ThisItem,
{
Name: ThisItem.Name,
Order: previousRecord.Order
}
);
On the down arrow, I have:
UpdateContext({nextRecord:LookUp(
Reorder,
Order = ThisItem.Order + 1)
});
Update(Reorder,
nextRecord,
{Name: nextRecord.Name,
Order: ThisItem.Order
}
);
Update(
Reorder,
ThisItem,
{
Name: ThisItem.Name,
Order: nextRecord.Order
}
);
The collection, at the start, before re-arranging, looks like thisL
The ensure a correct answer, the user needs to have the items in this order:
When the user clicks on the up or down option, the "Order" field updates as shown below:
I am then adding a label to the page where i want to specify if the user has put the items in the correct order. I was thinking that i could put a formula:
If(Reorder, Name = "Beginning" && Order = 1 & Name = "Planning" && Order = 2 & Name = "Preparation" && Order = 3 & Name = "Introduction" && Order = 4 & Name = "Main Ideas" && Order = 5 & Name = "Conclusion" && Order = 6, "Correct")
I am probably completely wrong with what i have put previously but if you could help point me in the right direction that would be great.
Hope this helps
Your Gallery would be valid with the following formula:
If(
Concat(yourGallery.AllItems, Name & ";") = "Beginning;Planning;Preparation;Introduction;Main Ideas;Conclusion",
"Correct"
)
Added the formula but it doesn't seem to be working. Here is the formula i have added:
If(
Concat(Gallery3.AllItems, Name & ";") = "Beginning;Planning;Preparation;Introduction;Main Ideas;Conclusion",
"Correct", "Wrong"
)
As you can see from the image, the gallery items are in the order outlined in the formula:
Would you have any ideas why this would be displaying as wrong or can you suggest a solution?
Sorry, forgot about the trailing semi-colon.
Formula should be:
If(
Concat(Gallery3.AllItems, Name & ";") = "Beginning;Planning;Preparation;Introduction;Main Ideas;Conclusion;",
"Correct", "Wrong"
)
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
257 | |
122 | |
85 | |
75 | |
72 |