cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
julilis
Advocate I
Advocate I

Gallery icon position

Hello everyone,
I am wondering if it is possible in each record to change the position of the icon.
For example, in the first record the icon is on the left side, and in the second record the icon is on the right side and the third record on the left again.

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
RezaDorrani
Dual Super User II
Dual Super User II

Hi @julilis 

 

It is possible but you will have to create an index field for each row in the gallery

Check this post on how to do this

https://powerusers.microsoft.com/t5/General-Discussion/Patching-an-item-index-number-into-a-collecti...

 

You can then set the X property of the icon based on index value 

example : If(Mod(ThisItem.Index,2)=0,40,100)

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

View solution in original post

3 REPLIES 3
RezaDorrani
Dual Super User II
Dual Super User II

Hi @julilis 

 

It is possible but you will have to create an index field for each row in the gallery

Check this post on how to do this

https://powerusers.microsoft.com/t5/General-Discussion/Patching-an-item-index-number-into-a-collecti...

 

You can then set the X property of the icon based on index value 

example : If(Mod(ThisItem.Index,2)=0,40,100)

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

View solution in original post

v-xida-msft
Community Support
Community Support

HI @julilis ,

Which data source do you use within your app? A SP List?

Do you add a Row Index column within your SP List?

 

If the data source you used witin your app is a SP List, based on the needs that you mentioned, you could configure your app as below:6.JPG

Set the X property of the Icon in your Gallery to following formula:

If(
Mod(ThisItem.ID,2)=0,
Parent.TemplateWidth - NextArrow2.Width-5,
0
)

If the data source you used in your app does not contain a Row Index column, please consider add a Number column in your data source to store the Row Index firstly.

I have made a test on my side, please take a try with the following workaround:

Set the OnStart property of the App to following:

Clear(TempCollction);
ForAll(
           RenameColumns('YourDataSource', "PrimaryColumn", "PrimaryColumn1"),
           Collect(TempCollction, 1);
Patch('YourDataSource', LookUp('YourDataSource', PrimaryColumn = PrimaryColumn1), {IndexColumn: CountRows(TempCollction)}) )

Note: The IndexColumn represents the Number column in your data source, which used to store the row index value.

Set the Items property of the Gallery to following:

'YourDataSource'

Set the X property of the Icon in your Gallery to following formula:

If(
Mod(ThisItem.IndexColumn, 2)=0,
Parent.TemplateWidth - NextArrow2.Width-5,
0
)

 

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@RezaDorrani  Thank you it worked!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (9,701)