0

I have made an app with 2 pannels one on the left is a text input box and the one on the right is a text output.

what i would like to do is enter words on a sharepoint list under OLDTXT and NEWTXT and it replaces those words in the text and displays this on the right.

thought it would be a simple

Substitute(
        Script.Text,
        Words_1, OLDTXT   ,
        Words_1, NEWTXT

    )

but alas power apps wont do it directly so i tried this

Refresh(Words_1);

ClearCollect(
    WordReplacements,
    Words_1
);

Refresh( Words_1)  ;


ClearCollect(
    WordReplacements,
    Words_1
);

ClearCollect(
    ModifiedTextList,
    ForAll(
        WordReplacements,
        Substitute(Script.NEWTXT, OLDTXT)
    )
);

Set(
    ModifiedOutput,
    Concatenate(ModifiedTextList, " ")
)

but the modified text list doest work. and the modified output has 3 rows 1 with each change. I wanted it to just output 1 record with the 3 changes in it.

does anyone know how i can complete this I tried in excel too but failed (please be simple as I am a bit slow on Power Apps ;)

Ian
  • 31
  • 6
  • I have tried to consolidate the output to one file but I just cant get the code right. I can see the 3 outputs all right but all wrong too lol. I will keep bashing away. I thought it is an interesting probelm I just think there is an easier way I dont know about – Ian Aug 10 '23 at 09:51
  • in what control properties are you using these formulas? You see, Power Apps distinguishes between 'behaviour' and 'non-behaviour' formulas and functions. Substitute is non-behaviour while your second formula is a series of behaviour functions. – mmikesy90 Aug 11 '23 at 07:27

0 Answers0