I'm trying to create a folder as part of a flow, based upon an excel cell value.
The flow works if I use a cell value from the excel sheet that is a straight value such as "Folder 1", but just comes up blank when I use a cell that is a formula such as "=B2 & " RFE " & ROW(2:2)".
Is there a way to get past this? Am I right in thinking that it's not working because I'm referencing a formula and not a value?
I can't speak to your flow specifically and the issue you're seeing with the way you're retrieving that value (you haven't shown it) but another way to pull data from Excel and be a lot more specific about it is to use Office Scripts.
If you've never used them before, this can help you get started.
https://support.microsoft.com/en-us/office/introduction-to-office-scripts-in-excel-9fbe283d-adb8-4f13-a75b-a81c6baf163a#:~:text=Getting%20started,steps%20you%20want%20to%20automate.
In relation to a script that can help you, if you create a new script called Get Cell Value and paste this code in ...
function main(workbook: ExcelScript.Workbook, worksheetName: string, cellAddress: string)
{
return workbook.getWorksheet(worksheetName).getRange(cellAddress).getText();
}
... you can then call it from PowerAutomate and it will give you the right answer.
You can see in my example, the first cell is a formula. From PowerAutomate using the Run script action, it works as expected.
You can then use the resulting value to create your folder.
Related
I am fairly new to selenium ruby/rspec scripting and I have come across a use case that requires data to be pulled from a csv or xlsx file in the test. Any help or suggestions on how to approach this would be greatly appreciated.
The test would pull from the csv file and input data from each row to complete the same actions against. This particular file contains a single column of "id's" and the same action would need to be repeated until all values from the column have been used. Here is the basic steps...
User logs in
User pulls first value (id) from file to search in text field
User completes action against this id
User returns to text field and pulls value from second row of same file
User completes action against this id
This would repeat until all rows are completed
Is this possible to complete the same method repeatedly but filtering through data from the file?
How would you pull the csv file into the script and specifically grab the first value (and subsequent values) throughout?
I know this is pretty vague but I have not seen any examples such as this in SO and researching online. Any suggestions or examples would very much appreciated.
I'm not sure I fully understand your question but I can try to point you in the right direction.
Ruby has a csv parser built in which you can read about here: CVS class
One of the first examples would seem to provide you with the functinoality you are looking for. I think in your example you would want to do something like:
CSV.foreach("path/to/file.csv") do |row|
#I'm assuming ID is the first element in each row
id = row.first
method_that_does_stuff(id)
# assert that stuff has happened ...
end
does that help get you started?
Its first my first time in stackoverflow to get help.
Im making a Ruby GUI with glade3, but i dont really now how to get texts from an entry box?
It should read the text from entry box and write it in an excel sheet.
I hope you can help me :)
See example here: https://xrob.wordpress.com/2007/04/20/creating-a-gui-application-using-glade-and-ruby/
We want to change something in the application so we will need to assign a variable to the widget that we want to alter. We want to alter “label1” and so we insert this code in the button1_clicked function.
#myEntryBox = #glade.get_widget(“myEntryBox”)
# You can now access properties like '#myEntryBox.text'
# Refer to documentation for exact name of the attribute
I'm using PowerBuilder 10.5 and as a newbie I'm a bit stuck and since Google isn't giving me a satisfying answer I'm asking some advice from the Stack Overflow group.
I have a Rich Text Edit field in which the user can write something, insert pictures and so forth. Once finished, he goes to the „Search“ command button and clicking it searches for the batch file that will suit his needs (copy that text into an existing word document, create a new word and place the folder on web, and so fort – there are 6 different batches). The code in the clicked event of „Search“ command button is this:
String ls_s
GetFileOpenName('PB_app', ls_s, ls_s, 'BAT', "Win Batch Files (*.BAT),*.BAT", 'C:\Programs\Test')
And here come my problems: I can't connect my app and the selected batch file. I'd like the path of the selected batch file to be visible in the Single Line Edit filed, but I have no idea how to get there, not to mention I'm point blank at how to connect PB app, batch file, how to even say to the batch file – „That text in rich text edit field is the one you have to work with?“…?
So I need some advice, guidance, perhaps some links or names of any literature that would help me understand how it should be done. I've lost two days and got nowhere, and I just need some piece of advice to get me going…
Your problem is that the original programmer used one variable for two return values. If you declare a new string variable and pass it instead of the first ls_s, you'll see this will return you the path. If you run into trouble, PB has a good help file (and the manuals are also online) which covers GetFileOpenName().
Good luck,
Terry
Could anyone help me figure out how to enter a value into a QTP data table using VBScript? I'm trying the following line, but it doesn't seem to work:
datatable.Value(D,"sheetName")="A"
What is wrong? I am used to other languages and just cannot see any problem here.
What is the D you're using? Is it a variable holding the column name? If not and you mean to use the D column then you have to quote it so that QTP (VBScript actually) knows you mean the string "D".
datatable.Value("D","sheetName")="A"
I know zilch about QTP tool. However, your syntax looks correct based on this example. (see heading Adding Value to you a local sheet
Based on the information given, I would take a stab that you may have not referenced the QTP DLL, you have ON ERROR RESUME NEXT in your code AND you do not have OPTION EXPLICIT set at the top of your module.
Start by making sure you have the correct DLL referenced and adding this line to the top of the code:
OPTION EXPLICIT
If you've done that, then add more information that could help one deduce the problem (e.g. full code sample).
The way that you get data from datatable in QTP is, first import the Excel sheet into your datatable (Either Global or Local), then try to get data from datatable using following Syntax
Datatable(columnName,dtGlobalSheet) if imported in Global sheet
Datatable(columnName,dtLocalSheet) if imported in Local sheet
Importing Data
myFile = "C:\datasheet\excelone.xls"
datatable.Importsheet myFile,1,Global
Enter Value
DataTable("Coumn1Data", dtGlobalSheet)
This way you can get data from Excel sheet.
Thanks,
Karthik
I have a variable in the MATLAB workspace and I want to pass the variable name and its contents to a function in my GUI.
How do I achieve this task?
I'm not totally sure what you mean when you say "pass the variable name and its contents", but here's one possible solution. After you pass a set of data to a function like so:
some_function(data); %# Pass the variable "data" to a function
You can get the variable name of the input argument from inside the function using INPUTNAME:
function some_function(inputArgument)
name = inputname(1); %# Will return "data" as the name of the input variable
end
EDIT: As pointed out in a comment by High Performance Mark, the variable inputArgument inside the function will contain the values stored in the variable data in the workspace of the caller.
If this question is related to your other most recent question, then why not build the operation into your GUI? You can use guide to create a pushbutton, and place the code under the callback function.
I am assuming that you have created the figure with GUI using the GUIDE, and that you know the 'Tag' names of the GUI objects.
((1)) Open the figure using the GUIDE, ((2)) Open the Property Inspector for the figure (select the background, the light-gray gridded area of the figure, and double-click over it, to make the Property Inspector for the figure to pop-up), ((3)) Turn the 'HandleVisibility' 'on' (by default, it may be set as 'callback'), ((4)) Save the figure and close the GUIDE, and finally ((5)) set the GUI property values from the MATLAB Console (or "Command Window") using some parameters that are currently available on your workspace.
I hope this helps.
Best,
Y.T.