cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

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

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!!!

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User
Super User

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

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)

View solution in original post

Highlighted
Resident Rockstar
Resident Rockstar

Re: First, Last, FirstN, LastN??!

@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

 

 

View solution in original post

5 REPLIES 5
Highlighted
Helper V
Helper V

First, Last,, FirstN, LastN??!! Please help

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!!!

Highlighted
Helper V
Helper V

First, Last, FirstN, LastN??!

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!!!

Highlighted
Resident Rockstar
Resident Rockstar

Re: First, Last, FirstN, LastN??!

@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

 

 

View solution in original post

Highlighted
Super User
Super User

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

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)

View solution in original post

Highlighted
Helper V
Helper V

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

@PaulD1
@KroonOfficeSol

 

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

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,643)