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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / First, Last, FirstN an...
Power Apps
Unanswered

First, Last, FirstN and LastN???!!!

(0) ShareShare
ReportReport
Posted on by

How can I make this work.

 

After trying so many different ways I came up with this.

 

I have a datacard called Job steps and I have 10 textinputs as shown below. (Also see pic for reference)

 

textinput 1

textinput2

textinput3

textinpit 4

.

.

.

.

textinput10

 

I want the textboxes to get back their default values when user opens the submitted form in edit mode.

 

I used If(!Exisitng, "1.", First(Split(ThisItem.JobSteps,"|")).Result). -- - I am checking if it is not an existing form then have 1. in the textinput, if not (if its edit form) have the defaulted value that the user submitted when they created this form.

 

Technically the above formula works for my First TextInput but how can I get back the other TextInput information?

 

I tried the formula (See below) For the second textinput but I am not sure how to make this work.

 

My patch function for this coloumn is 

jobsteps: Concatenate(TextInput7.Text,"|", TextInput8.Text, "|", TextInput14.Text)

 

 

Any help is highly appreciated!!!

 

Categories:
I have the same question (0)
  • asdeev Profile Picture
    on at

    After trying so many different ways I came up with this.

     

    I have a datacard called Job steps and I have 10 textinputs as shown below. (Also see pic for reference)

     

    textinput 1

    textinput2

    textinput3

    textinpit 4

    .

    .

    .

    .

    textinput10

     

    I want the textboxes to get back their default values when user opens the submitted form in edit mode.

     

    I used If(!Exisitng, "1.", First(Split(ThisItem.JobSteps,"|")).Result). -- - I am checking if it is not an existing form then have 1. in the textinput, if not (if its edit form) have the defaulted value that the user submitted when they created this form.

     

    Technically the above formula works for my First TextInput but how can I get back the other TextInput information?

     

    I tried the formula (See below) For the second textinput but I am not sure how to make this work.

     

    My patch function for this coloumn is 

    jobsteps: Concatenate(TextInput7.Text,"|", TextInput8.Text, "|", TextInput14.Text)

     

     

    Any help is highly appreciated!!!

  • asdeev Profile Picture
    on at

    After trying so many different ways I came up with this.

     

    I have a datacard called Job steps and I have 10 textinputs as shown below. (Also see pic for reference)

     

    textinput 1

    textinput2

    textinput3

    textinpit 4

    .

    .

    .

    .

    textinput10

     

    I want the textboxes to get back their default values when user opens the submitted form in edit mode.

     

    I used If(!Exisitng, "1.", First(Split(ThisItem.JobSteps,"|")).Result). -- - I am checking if it is not an existing form then have 1. in the textinput, if not (if its edit form) have the defaulted value that the user submitted when they created this form.

     

    Technically the above formula works for my First TextInput but how can I get back the other TextInput information?

     

    I tried the formula (See below) For the second textinput but I am not sure how to make this work.

     

    My patch function for this coloumn is 

    jobsteps: Concatenate(TextInput7.Text,"|", TextInput8.Text, "|", TextInput14.Text)

     

     My datasource is SQL and Jobsteps is one of the coloum in it.

     

    Any help is highly appreciated!!!

  • Verified answer
    KroonOfficeSol Profile Picture
    587 on at

    @asdeev

     

    For the second and so on you could try

    Last(FirstN(Split(ThisItem.JobSteps,"|"),2))).Result)

    Change the 2 to 3,4,5,6,7 and so on.

     

    Should work I would think.


    Paul

     

     

  • Verified answer
    PaulD1 Profile Picture
    2,914 on at

    If I understand correctly, you want to get back element N from an array.

    For element 1 you are using: If(!Exisitng, "1.", First(Split(ThisItem.JobSteps,"|")).Result)

    For element 2 you can use a combination of Last and FirstN, e.g.

    If(!Exisitng, "1.", Last(FirstN(Split(ThisItem.JobSteps,"|"),2)).Result)

    So you are saying, return the first 2 items and give me the last one.

    To get element 3 would be:

    If(!Exisitng, "1.", Last(FirstN(Split(ThisItem.JobSteps,"|"),3)).Result)

  • asdeev Profile Picture
    on at

    @PaulD1
    @KroonOfficeSol

     

    This is awesome! Thank you thank you thank you!! It works.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard