web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using Last and First t...
Power Apps
Answered

Using Last and First to grasp records targeted but has problems......

(0) ShareShare
ReportReport
Posted on by 152

Hello,

I'm building a Canvas app with SharePoint as a DataSource.

There is Collection named "colDialEditC" with column "IncomingOrder", "PhoneExtention", "PhoneNumber" ,"LineType", like such.

 

I'm creating screen for printing and I need to have table to show values in collection.

With several reasons and requirements, I cannot place Gallery control to this screen. Instead, I should put text controls independently.

In order to show value for each text box,  I did like this. (below shot shows)

2022-02-06_21-59-13.jpg My problem is ... let's say, if this collection contains only 8 row data, the rest of static text box value shows the "last value" of this collection repeatedly.

 

Is there any way to solve this problem?

Thanks for your help.

Categories:
I have the same question (0)
  • Verified answer
    Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @Sam44 

    You can try counting the number of rows in your collection. Then have a condition for each of your labels like so:

    If(CountRows(colDialEditC) >= 2, Last(FirstN(colDialEditC,2)).IncomingOrder,"")
    If(CountRows(colDialEditC) >= 3, Last(FirstN(colDialEditC,3)).IncomingOrder,"")

    And so on...

     

     

  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @Sam44 

    The solution from @Adrian_Celis looks good. But what prevents you from using a Gallery?

  • AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at

    This is completely unrelated to the post but @PowerRanger  I love you User Name I can't believe I never went with anything as cool as this 😂

  • CU-21080815-8 Profile Picture
    152 on at

    Thank you @Adrian_Celis  for your practical help and I got your point!!

  • CU-21080815-8 Profile Picture
    152 on at

    A layout issue....

    But I'm now changing my mind to somehow use Gallery instead of static text controls by separating one collection into 2 gallery so far.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard