Onboarding random show

Hi there!
If I had 20 rows that I want to show in an Onboarding view, how can I show them in a random way with a filter that show only 1 view per day?

0 15 687
15 REPLIES 15

The easiest way is to use RANDBETWEEN(1,20) to identify the row you want to show. However, this will not change just once a day โ€“ it will change every time something on the app is edited. If you need to have it be consistent for a full 24 hour period, I can think of two ways:

  1. If you donโ€™t really need randomness, you could just have it change once a day:
    mod(hour(today()-date(โ€œ4/11/2020โ€))/24,20)+1
    This goes from 1 to 20, moving up by one each day, and the returns to 1 after 20. As I recall, counting days is hard so, instead, it counts hours and then divides them by 24.

  2. If you need it to be more random, please see the following post of mine:
    Randomize sort order every 3 hours

Thanks @Kirk_Masden I will try this and see how it looks.

I got a creative idea from this post. I have two questions.

  1. where do I use the expression: mod(hour(today()-date(โ€œ4/11/2020โ€))/24,20)+1
    I tried putting it as a show if expression on the onboarding form but it resulted in a wrong data type. Same with putting it on a slice row filter expression. Thanks for clarifying for me.

  2. Is it possible to show this view only the first time a user opens the app each day? Thatโ€™s not necessary but could be nice.

thanks.
Lucinda

Youโ€™d have to have some way of determining โ€œfirst timeโ€ of โ€œeach dayโ€ for the user. There is no inherent way to do that, so youโ€™d have to devise something.

Right. You could record the first opening each day with an action. I have an action that records the date. It only gets invoked once because if the date is the same thereโ€™s no need to write over it. If the user already has the current date written into that cell, itโ€™s not their first time today.

Kirk, Iโ€™d be interested in how your action works but Iโ€™m more interested in where to put the mod expression shown above.
Thanks.

Hi @Lucinda_Mason!

I see now that I missed a question you raised earlier. In regard to where to put the expression I introduced, I used it to make a slice in which the keys for the table are in numerical order, from 2 to 124 in my case. This slice is just one record and it stays constant for an hour and then changes in my app.

Hereโ€™s the expression I use in my app:

mod((year(now())*month(now())*day(now()))/(hour(timenow()-โ€œ00:00:00โ€)+1),123)+2

Itโ€™s not really random โ€“ just sort of random.

Hi!
I just create a SLICE, add your mod formula, with a KEY column type number, but this is gettin an error: โ€œThe expression is valid but its result type โ€˜Numberโ€™ is not one of the expected types: Yes/Noโ€.
What I am missing?

If your KEY column is a number then [KEY]=5 (for example) should work as a slice condition, right? So, if you have a more complicated expression, such as the one I suggested, that is preceded by "[Key]= " I think it should work.

Ok!
Many Thanks! I understand now

Hey Kirk!
I try many ways with your expression, it works, but is not showing any row in the UX.
To things are happen, sometimes is showing the info of a Random row and sometimes is not showing any info of any row.

Hi! Sorry itโ€™s not working for you. Could you give me the exact expression as you are using it and tell me the range of numbers you need? Perhaps the expression is generating the wrong numbers.

By the way, you can test the expression to see what numbers it is generating. That might help.

Hi!
This is it: [UID]=mod((year(now())*month(now())*day(now()))/(hour(timenow()-โ€œ00:00:00โ€)+1),7)+2

[UID] is a column number key 1 to 7

Coming back to this since I learned โ€œFrom engineering The โ€œStarting viewโ€ option is meant to when the app is opened at the very first time. Thatโ€™s why it works if you reinstall the app. We try to open the last opened view when the app is reopened.โ€

So how are people getting the Onboarding view to show more often? I WAS calling it from the starting view if the user wasnโ€™t a new user.

Iโ€™d love to have it open whenever the user comes back into the app, or once a day. Since the app is trying to open the last view, can we over-ride that and show what we want?

Nope.

Top Labels in this Space