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 / vbScript output syntax?
Power Automate
Answered

vbScript output syntax?

(0) ShareShare
ReportReport
Posted on by 79

Hi,

I am running PAD for SAP using vbScript and had echo out 4 items into it's variable hereby %VBScriptOutput%

How do i write each item onto excel?
i tried %VBScriptOutput[1]% onto cell A1 but it only wrote 9, how do i write the entire 99047030 onto cell A1?

What is the syntax i should put?

Thanks

 

Zy_Sin_0-1712331847621.png

 

I have the same question (0)
  • eetuRobo Profile Picture
    4,343 Super User 2025 Season 2 on at

    I think the issue there is that your syntax is doing if without comparing it to anything. You would need to compare it to something. What are you trying to check in that if statement?

    So lets assume %TextList[1]% = 123. Your syntax is asking "If Not 123 then do something" but the syntax doesn't determine what should be 123. 
    Also I am not sure but it might be better to use <>
    So if you want to check if it is empty then:
    If %TextList[1]% <> "" Then

  • Zy_Sin Profile Picture
    79 on at

    Hi 
    it works

    can you help with this syntax

    i want it to do the following if the split text item 1 is not empty but it don't seem to work for what i wrote here

    if Not %TextList[1]% Then

    ....

    thanks

    Zy_Sin_0-1712337954110.png

     

  • Verified answer
    Deenuji_Loganathan_ Profile Picture
    6,250 Super User 2025 Season 2 on at

    @Zy_Sin 

    Please follow the below suggested approach.

    First use split function and split your text variable(vbscriptoutput) with newline and iterate with foreach and write into your excel.

    Deenuji_0-1712332500724.png

     

    Code:

     

    Excel.LaunchExcel.LaunchUnderExistingProcess Visible: True Instance=> ExcelInstance
    SET VBScriptOutput TO $'''99047030
    90019853
    0.00
    515.83'''
    Text.SplitText.Split Text: VBScriptOutput StandardDelimiter: Text.StandardDelimiter.NewLine DelimiterTimes: 1 Result=> TextList
    LOOP FOREACH CurrentItem IN TextList
     Excel.GetFirstFreeRowOnColumn Instance: ExcelInstance Column: $'''A''' FirstFreeRowOnColumn=> FirstFreeRowOnColumn
     Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: CurrentItem Column: $'''A''' Row: FirstFreeRowOnColumn
    END

     

     

    How to copy/paste above code into your power automate flow?

    Deenuji_1-1712332609893.gif

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

     

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
David_MA Profile Picture

David_MA 265 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 203 Most Valuable Professional

#3
trice602 Profile Picture

trice602 202 Super User 2025 Season 2

Last 30 days Overall leaderboard