Change Style dynamically

Is it possible to dynamically change style from details to list when more than one item?

I would say probably not. Might be a good feature request with an option to turn it on or off. The List Relation component works like this. One item in the List Relation will take you directly to details. More than one item in the List Relation will take you to the list.

Thanks @Jeff_Hager! The List Relation component does not help. This is the case: User profile filtered on signed-in user. Occassionally a couple share the same email address. Would like to avoid the extra step with List style for all single users.

1 Like

@Mark is this something you would put on the todo list?

I suppose if you really needed something now, you could create a relation column in the sheet linking back to itself using email. Then create a Rollup column to count the number of records in the relation with that email. Display the tab with the Detail style layout. Set Visibility on all components to only show if the Rollup count equals 1. Finally add an inline list using the relation and set visibility if the Rollup count is greater than 1.

2 Likes

Exactly what I was going to suggest!

1 Like

Relation column in sheet or app data? Do not fully understand, grateful a step by step instruction!

I’m talking about a relation column set up in the data tab.

  • Create the Relation column to link the email column to the same email column in the same sheet.
  • Create a Rollup column that uses the relation to build a count of related records.
  • Create a tab that displays this sheet in the Detail style layout and filter the tab by signed in user.
  • Add components to show drugs for a single user.
  • Set the visibility on all of these components to only display of the Rollup column count is equal to 1.
  • Add an inline list component that uses the Relation column for it’s data source.
  • Set the visibility on the inline list to only show if the Rollup column count is 2 or greater.

Thank you, but Count in Rollup column returns the total of the Relation column?

It should return the count of the related rows as long as you point it to the relation.

Count in Rollup column does not return 1 or 2. Se example:

Two things…it looks like your relation may not be set to Multiple, and can you post a screenshot of the Rollup settings? Based purely on your screenshot, I expect to see 1, 1, 2, 2 in the Rollup column.

1 Like

Thank you @Jeff_Hager, Relation was not set to Multiple!

1 Like

Have now completed the solotion, works better than expected, Feature Request not needed!

1 Like

Glad you got it to work. Genuinely curious though, what did you have in your Rollup column settings to show 3, 2, 1, 0?

Frankly speaking I don’t know, unable recreate it!

1 Like

hehe, ok. No problem.

1 Like