cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AkshayAuradkar
Frequent Visitor

how to user more than 1 actions in item of gallary

Hello Experts,

 

I have pagination function in Item of gallary i also want search function there  

 

If('Gallery Pagination_1'.OutCurrentPage = 'Gallery Pagination_1'.OutTotalPages,LastN(FirstN(MySPCollection,'Gallery Pagination_1'.OutPageCounter),(InTotalItemsCount - ('Gallery Pagination_1'.OutPageCounter - 'Gallery Pagination_1'.OutItemsPerPage))),LastN(FirstN(MySPCollection,'Gallery Pagination_1'.OutPageCounter),'Gallery Pagination_1'.OutItemsPerPage))  + search

1 ACCEPTED SOLUTION

Accepted Solutions

@AkshayAuradkar 

Your current formula is just missing a closing parenthesis.

With(
    {dataRecords: Search(MySPCollection, TextInput1.text,"Title")},
    
    If('Gallery Pagination_1'.OutCurrentPage = 'Gallery Pagination_1'.OutTotalPages, 
        LastN(
           FirstN(MySPCollection,'Gallery Pagination_1'.OutPageCounter),
           (InTotalItemsCount - ('Gallery Pagination_1'.OutPageCounter - 'Gallery Pagination_1'.OutItemsPerPage))
        ),
        LastN(
           FirstN(dataRecords,'Gallery Pagination_1'.OutPageCounter),
           'Gallery Pagination_1'.OutItemsPerPage)
       )
)  

 

Please keep in mind, I am only checking your syntax and offering a way to do this formula a little easier.  As far as your actual logic and what records and "pages" are returned may still be suspect.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

5 REPLIES 5
RandyHayes
Super User III
Super User III

@AkshayAuradkar 

You might consider using a With statement.

Example:

With({dataRecords: Filter(MySPCollection, yourSearchCriteriaHere)},

   here goes your current formula, just replace MySPCollection in your formula with "dataRecords"
 
)

 

AND, by the way - you have a syntax mistake in your posted formula (which is why I did not actually put it in the formula above).

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Hi thank you for your help

 

can you please help me with the formula

With({dataRecords: Search(MySPCollection, TextInput1.text,"Title")},If('Gallery Pagination_1'.OutCurrentPage = 'Gallery Pagination_1'.OutTotalPages,LastN(FirstN(MySPCollection,'Gallery Pagination_1'.OutPageCounter),(InTotalItemsCount - ('Gallery Pagination_1'.OutPageCounter - 'Gallery Pagination_1'.OutItemsPerPage))),LastN(FirstN(dataRecords,'Gallery Pagination_1'.OutPageCounter),'Gallery Pagination_1'.OutItemsPerPage))

 

I am trying this buy still getting error

@AkshayAuradkar 

Your current formula is just missing a closing parenthesis.

With(
    {dataRecords: Search(MySPCollection, TextInput1.text,"Title")},
    
    If('Gallery Pagination_1'.OutCurrentPage = 'Gallery Pagination_1'.OutTotalPages, 
        LastN(
           FirstN(MySPCollection,'Gallery Pagination_1'.OutPageCounter),
           (InTotalItemsCount - ('Gallery Pagination_1'.OutPageCounter - 'Gallery Pagination_1'.OutItemsPerPage))
        ),
        LastN(
           FirstN(dataRecords,'Gallery Pagination_1'.OutPageCounter),
           'Gallery Pagination_1'.OutItemsPerPage)
       )
)  

 

Please keep in mind, I am only checking your syntax and offering a way to do this formula a little easier.  As far as your actual logic and what records and "pages" are returned may still be suspect.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Hello still getting the error that the search function has some invalid arguements

@AkshayAuradkar 

So if it is complaining about the search function, what specifically does it have for an error? Hover over parts of the search formula and observe the error messages.  The Search part of your formula is relatively small, so it should be easy to spot the problem.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (43,017)