
Announcements
I want to set a user 1 of 6 colours when they first start the app. I have a User table with a Profile Colour column, I also have a collection with 6 different colours in it. Any idea how I can randomly patch one of the colours in the collection to the Profile Colour column?
Hi @philkky12
First, your collection should be something like this:
ClearCollect(ColorsCollection,
Table(
{Number:0,Color:"Green"},
{Number:1,Color:"Yellow"},
{Number:2,Color:"Red"},
{Number:3,Color:"Blue"},
{Number:4,Color:"Black"},
{Number:5,Color:"White"}
)
)Then you can patch your table like this
Patch(User,TheRecordThatYouWantToPatchHere,
{'Profile Colour':LookUp(ColorsCollection,Number = Round(Rand()*5,0)).Color}
)