cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
relleK
Regular Visitor

Output to Google Sheets refuses to be number (Integer), always stuck as text.

Hello,

 

I've tried several different approaches to get this flow to send output to google sheets NOT as text. No matter what I try, the flow generates the output as text before it sends even though it's definitely calculated as an integer.

 

I don't see how it can be anything wrong with the way the flow is set.

 

Here is the RAW input/output:

 

Untitled.png

I've tried:

  • Initialize blank Variable as Integer -> Set Variable as: int(outputs('Get_a_row')?['body/WEST DOCK'])
  • Initialize Variable directly to integer with: int(outputs('Get_a_row')?['body/WEST DOCK'])
  • Adding directly to the Update row block several different ways
    • As an Outputs
    • as a Variable
    • as an add()
    • as a mul()
      • ALL of these produce the desired results as you can see in the RAW input/output

So, why is it when the output gets posted, it's back to a string inside quotation marks?

 

The sheet:

 

2.png

 

Can anyone please tell me what I'm missing here?

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support
5 REPLIES 5
v-xiaochen-msft
Community Support
Community Support

Ahammad_Riyaz
Super User
Super User

Hi @relleK 

 

Please refer this.

https://powerusers.microsoft.com/t5/General-Power-Automate/Convert-text-to-number/td-p/40748

 

int(outputs('Compose'))

 

Regards

Ahammad Riyaz

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

@Ahammad_RiyazI Tried this approach already. The output is always the same, even when the input is an integer.

@v-xiaochen-msftThank you, It's not a solution, but it is an answer. Glad I gave up on trying to get it to work! 😂

For the record in case someone else finds there way here:

 

Create an Apps Script in Google Sheets, with a trigger Event Type to run after any "Change." Setting this to "On Edit" did not trigger the script to run.

 

Here is the script I used. Just adjust the number format however you need it, and you could even break this down by the cell in case you need different formats. After adding and deploying this, as soon as PA sends the data, the script gets rid of the 'tick.'

 

function myFunction() {
  
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];

// Select Range
var column = sheet.getRange("C2:J53");

// Set Format
column.setNumberFormat("0");
}

 

relleK_1-1649863742463.png

 

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (3,702)