cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

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

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (54,949)