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 Automate / convert ascii code to ...
Power Automate
Unanswered

convert ascii code to character in power automate

(1) ShareShare
ReportReport
Posted on by 65

convert ascii code to character in power automate

Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,422 Moderator on at

    Can you clarify the question a little please?

  • Tourist Profile Picture
    65 on at

    MicrosoftTeams-image (3).png

    Want to create dynamic range of tables in Excel with ASCII value which is coming from length of array @Paulie78 

  • Community Power Platform Member Profile Picture
    on at

    This might be a bit old but I too ran into the same issue and to set an Excel range dynamically, this feature would make it a lot easier. It is a shame that Power Automate does not provide it, however, for those who are still looking for a solution, I resolved the challenge of creating a dynamic range by using a simple substring function. So, provided you have the number of columns you want to display (say from a already generated columns list array), the range can be set by a series of conditions in 26 character chunks (sure you can create a humongous string but this is a little easier for me) as follows.

     

    Gerry55_0-1649421639286.png

    The test condition is "length(columnsListArray)" and the set value is "concat('A1:',substring('ABCDEFGHIJKLMNOPQRSTUVWXYZ',sub(length(columnsListArray),1),1))". Once you get past 26, then next set value is based from "A1:A", and the next "A1:B", and so forth. And I am sure this could be optimized for for now, this works for me.

     

    Hope this helps someone and seeds some ideas for a better solution.

     

  • zharevski Profile Picture
    2 on at

    Hello @Gerry55 thank you for this solution, can you provide me the formula if the length is greater than 26? I don't quite understand what to write in the concat formula on this case.
    Thank you in advance!

  • gvc55 Profile Picture
    6 on at

    Hello Zharevski,

     

    I have forgotten I had written this response, it’s been a while since then. In any event, the code has change since then making it a bit easier to implement although perhaps not as easy to follow. In the end, it yields the same results. Here is what has changed.

     

    The main steps are to convert any incoming data into an Excel range. First, I determine some necessary parameters from the incoming columns list, and then use those parameters to determine the range.

     

    The first step is to determine how many chunks of 26 are in the incoming columns list (an array or JSON records) using the MOD operator and the remainder (what’s left over from the last 26) using the DIV operator as follows.

     

    mod(length(Columns_List), 26)

    div(length(Columns_List), 26)

     

    The results are then used on the next step to determine the Excel Table range as follows.


    concat('A1:',

        if(and(equals(outputs('Set_Excel_Range_parameters')['MOD'], 0),

              equals(outputs('Set_Excel_Range_parameters')?['DIV'], 0)),

           substring(outputs('Set_Excel_Range_parameters')?['LIST'],outputs('Set_Excel_Range_parameters')?['DIV'],1),

           if(equals(outputs('Set_Excel_Range_parameters')?['DIV'], 1),

              substring(outputs('Set_Excel_Range_parameters')?['LIST'],sub(outputs('Set_Excel_Range_parameters')?['DIV'],1),1),

           if(greater(outputs('Set_Excel_Range_parameters')?['DIV'], 1),

              substring(outputs('Set_Excel_Range_parameters')?['LIST'],sub(outputs('Set_Excel_Range_parameters')?['DIV'],2),1),'')

            )

        ),

        if(and(equals(outputs('Set_Excel_Range_parameters')?['MOD'],0),

               equals(outputs('Set_Excel_Range_parameters')?['DIV'],0)),

            '',

            substring(outputs('Set_Excel_Range_parameters')?['LIST'],

                   if(equals(outputs('Set_Excel_Range_parameters')?['MOD'],0),25,sub(outputs('Set_Excel_Range_parameters')?['MOD'],1)),1)

        ),

        '1'

    )

     

     

    I hope this helps you. Let me know if you have any other questions.

     

  • gvc55 Profile Picture
    6 on at

    BTW, I could not send the image of the flow I wanted, something to do with my business account and this one, so here is what I missed.

    Gerry1155_0-1720026360952.png

     

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard