I have a filter which starts:
Sort(Filter(
colCA, If (vCompanyUser <>("Smiths"), CompanyUser, false),
If( ---------a ton of code that basically sets out what should be displayed when a toggle is off or on)
What I am trying to achieve is, if our company, “Smiths”, are using the App, we see all the rows in the collection, if any other Company logs in, they only see the rows applicable to that company. I am pretty sure the <> is wrong but then ! is only for boolean values. Maybe my syntax is just plain wrong.
Solved! Go to Solution.
@Automate2create So your formular will look something like that:
If(vCompanyUser = "Smiths",colCA,Filter(colCA,CompanyUser = vCompanyUser))
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
If(
vCompanyUser <>"Smiths",
Sort(Filter(colCA,CompanyUser = vCompanyUser),'Input_Date_Time', Descending),
Sort(colCA,'Input_Date_Time', Descending)
)
If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!
Best regards,
Gonçalo Nogueira
Check my LinkedIn!
Buy me a coffee!
Check my User Group (pt-PT)!
Last Post on Community
My website!
Thanks, I see, I've been able to learn from both yours and @PowerRanger's responses. Thank you very much!
1.) Could you tell me the field name in ColCA which should be used for filtering.
2.) How do you determine to which company a user belongs to?
What is vCompanyUser??
If it is a lookup you must use something like:
vCompanyUser .Name
If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!
Best regards,
Gonçalo Nogueira
Check my LinkedIn!
Buy me a coffee!
Check my User Group (pt-PT)!
Last Post on Community
My website!
Hi PowerRanger
The field name in ColCA which should be used for filtering is CompanyUser.
The way I am thinking of the formula is if( variable vCompanyUser does not equal "Smiths", then filter on CompanyUser from colCA otherwise you are logged in as Smiths so bring back all rows in the datatable using the Collection)
vCompanyUser is a variable that stores the name of the Company who is logged in to the app.
@Automate2create So your formular will look something like that:
If(vCompanyUser = "Smiths",colCA,Filter(colCA,CompanyUser = vCompanyUser))
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
If(
vCompanyUser <>"Smiths",
Filter(colCA,CompanyUser = vCompanyUser),
colCA
)
If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!
Best regards,
Gonçalo Nogueira
Check my LinkedIn!
Buy me a coffee!
Check my User Group (pt-PT)!
Last Post on Community
My website!
This is great, the other question is how would I be able to to filter ColCA on 'Input_Date_Time', Descending.
I have tried but haven't got it yet
If(vCompanyUser = "Smiths",colCA('Input_Date_Time', Descending), Filter(colCA ('Input_Date_Time', Descending), CompanyUser = vCompanyUser)
If(
vCompanyUser <>"Smiths",
Sort(Filter(colCA,CompanyUser = vCompanyUser),'Input_Date_Time', Descending),
Sort(colCA,'Input_Date_Time', Descending)
)
If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!
Best regards,
Gonçalo Nogueira
Check my LinkedIn!
Buy me a coffee!
Check my User Group (pt-PT)!
Last Post on Community
My website!
Thanks, I see, I've been able to learn from both yours and @PowerRanger's responses. Thank you very much!
User | Count |
---|---|
252 | |
126 | |
104 | |
50 | |
50 |