Defining a new variable in order to make a huge iteration giving me an error - rest

I have an endpoint, you can have información about products
{{URL_API}}/products/
If i perform a GET method over that endpoint i will obtain the information of every product
BUT i can also specify the product that i want to know about, i.e:
{{URL_API}}/products/9345TERFER (the last code is the id of the product, called SKU)
The problem is that if i want to make a CSV in order to update the information of different products i have to define a variable called sku in the endpoint so i will be able to pass the corresponding SKU
I want to create the variable {{sku}} but i do not understand how to do that.. i tried so many times and i failed, i've searched a lot but i do not really understand
Also, should i use ":" before the declaration of the variable? i mean:
{{URL_API}}/products/:{{sku}}
or simply:
{{URL_API}}/ns/products/{{sku}}
Can you help me?
I'm super lost :(
EDIT:
I want to perform a PUT method, i want to pass different values to the body and then.. send the request (it throws an error: 404 not found)
This is what i did:
PUT|{{URL_API}}/products/{{sku}}
body:
{
"tax_percentage":"{{tax_percentage}}",
"store_code":"{{store_code}}",
"markup_top":"{{markup_top}}",
"status":"{{status}}",
"group_prices": [
{
"group":"{{class_a}}",
"price":"{{price_a}}",
"website":"{{website_a}}"
}
]
}
CSV:
POSTMAN:

Your issue seems to be just a basic understanding of how data files work with variables in Postman, here's a simple example that will work the same way for you too.
This is a basic request I'm using to resolve the variable from the data file - It's a GET request but that doesn't matter as all we're look at here is using a data file to resolve variables. All you need to do is ensure the URL is correct and that you SAVE the request before using the runner.
Here's a simple CSV file created in a text editor. The heading sku in the name on the variable it will reference inside the Postman request. Each value under that is the value that will be used for each iteration.
In the Runner, select your Collection from the list (If you have more than one) then select the CSV file. Once imported, you will be able to see a preview of the data.
If that's correct, press the Run button. The Runner will then iterate through the file and pick up the sku value in the CSV file and use it in the request. I've expanded one of the requests so you can see that the value was used in the request.

Related

I’m getting below error while I try to execute a workflow on Powercenter

Transformation Parse Warning [<<P M Parse Warning>> <<Invalid constant sun-expression>> <<Expression Error>> [TO_DATE]:invalid string for converting to Date
… t:TO_DATE(s:s:”,s:s:’YYYYMMDD’)
……….
AND SATIS_TARIHI = >>>> TO_DATE($$RUN_DATE,’YYYYMMDD’)<<<<];
How can I solve this?
This is the first time I encounter this error. Normally, this is a daily routine for our job. The parameter is successfully added to the mapping and all the other things seem okay. I’d appreciate your help.
I tried to start the workflow and got this error.
You need to define a $$RUN_DATE in mapping. Currently its not defined in mapping or its null in parameter file.
You need to set a default value in mapping like 20221221 for today.
Or else you can set it up in a parameter file like this
[folder.workflow_name]
[folder.session_name]
$$RUN_DATE=20221221
Considering this is your daily routine and up till now it has been working fine, I assume this is not a new development and no recent changes have been made. Apparantly PowerCenter got an invalid value for the parameter.
Check you parameter file and how it gets generated.
Was the process of generating paramfile executed without issues?
Was there enough storage space?
Can you verify the paramfile contents?
Can you regenerate it?
Can you modify it and provide some value manually?
Feel free to get back with some updates for more help if your problem won't get resolved by checking the items on the list above.

Automatically download emails from Outlook with SAS or Outlook rule

I am trying to create a program to automatically download the attached files that are sent to us from a certain email and then transform the delimiter with SAS, of those csv that are attached to us and pass those csv through a flow that I have already created.
I have managed to create a program that treats the csv as I want and the delimiter that I want, the problem is that when it comes to automating the download of files from Outlook it does not work.
What I have done is create a rule with the following VB code that I found on the internet:
Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
Dim oAttachment As Outlook.Attachment
Dim sSaveFolder As String
sSaveFolder = "C:\Users\ES010246\Desktop"
For Each oAttachment In MItem.Attachments
oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName
Next
End Sub
I have changed the path to my personal path where i want the files are downloaded.
website: https://es.extendoffice.com/documents/outlook/3747-outlook
The problem is that this code does not work for me, it does absolutely nothing for me and no matter how much I search the internet, only this code appears.
Is there any other way to do with SAS what I want? What is it to automatically download 8 csv files sent to me by Outlook, or has someone experienced the same thing as me with VBA?
I have followed all the steps about 7 times so I think the error is not in copying the code or selecting certain options wrong, in fact I had copied and pasted the code and later I modified the path where I wanted those to be saved. files but it doesn't work, does anyone know why?
I will be tremendously grateful, thank you very much for everything!
First of all, you need to make sure the file name and path doesn't include forbidden symbols.
The VBA macro used for a rule in Outlook is absolutely valid except that a mail item may contain the attached files with the same name, so a file saved to the disk may be overwritten (saved with the same name). That's why I'd suggest generating a file name with your own unique IDs making sure that DisplayName property is not empty and has a valid name what can be used for file names (exclude forbidden symbols).
Also you may consider handling the NewMailEx event of the Application class which is fired when a new message arrives in the Inbox and before client rule processing occurs. Use the Entry ID returned in the EntryIDCollection string to call the NameSpace.GetItemFromID method and process the item. This event fires once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem, or SharingItem.
The Items.ItemAdd event can be helpful when items are moved to a folder (from Inbox). This event does not run when a large number of items are added to the folder at once.

How do I display the result of a SendHTTRequest Activity?

I have a SendHTTPRequest activity in an Elsa Workflow and it executes correctly, but the response doesn't get displayed even though I selected Read Content. The page is still empty. Why isn't it showing the result?
There isn't any documentation on SendHTTPRequest but after looking at the source code and some trial and error, I was able to get the response to show by adding a WriteHTTPResponse after the SendHTTPRequest. The SendHTTPRequest also needed some additional configuration:
Add values in the Supported Status Codes section. This creates the different flow paths after execution.
Give it a Name (e.g. GetHTTP) so you can get access to the response in WriteHTTPResponse.
Now drag the status code path to WriteHTTPRequest so it will execute that activity on a 200. In the Content section you can then use an expression to output the response.
E.g. GetHTTP.Response.Content and select JavaScript from the dropdown.

Xpath starting retuning None on Scrapy

I'm trying to crawl a site and to do so, I'm using Scrapy. So, when doing requests to nested pages, the procedure usually gets the the information correctly on the first trials, but, on later requests the nodes starts to return None. I'm using xpath's functionality. Below I'm pasting some lines of the parse function:
(I tried this one with the approach of explicitly comparing the class value)
title = response.xpath('//span[#class="inlineFree"]/text()').extract_first()
(With this one I used the contains function)
view = response.xpath('//span[contains(#class,"count")]/text()').extract_first()
(I've also used this one when I found more suitable)
comments = response.css('div.commentMessage > span::text').extract()
Am I doing something wrong on paths?
Is there any reason for the crawler to stop reading the nodes correctly?
Cannot say what the problem is without the log messages or the spider code but..
What happens most of the time is that websites fo not follow a strict html structure .For some properties the 'title' may be inside the span
but for the next iteration it may be
span[#class="inlineFree"]/h1/text() or or any other tag
so you should check the html for those returning None

Problems with GitHub rendering my README.rst incorrectly..?

I've got a GitHub repo/branch where I'm attempting to update the README.rst, but it's not formatting the way I expect when it comes to the bullet lists I'm including.
Everything seems ok except for my Usage section, in which I have the following:
*****
Usage
*****
- Open the template file that corresponds to the API call you'd like to make.
* Example: If we want to make a call to the RefundTransaction API we open up /templates/RefundTransaction.php
- You may leave the file here, or save this file to the location on your web server where you'd like this call to be made.
* I like to save the files to a separate location and keep the ones included with the library as empty templates.
* Note that you can also copy/paste the template code into your own file(s).
- Each template file includes PHP arrays for every parameter available to that particular API. Simply fill in the array parameters with your own dynamic (or static) data. This data may come from:
* Session Variables
* General Variables
* Database Recordsets
* Static Values
* Etc.
- When you run the file you will get a $PayPalResult array that consists of all the response parameters from PayPal, original request parameters sent to PayPal, and raw request/response info for troubleshooting.
* You may refer to the `PayPal API Reference Guide <https://developer.paypal.com/webapps/developer/docs/classic/api/>`_ for details about what response parameters you can expect to get back from any successful API request.
+ Example: When working with RefundTransaction, I can see that PayPal will return a REFUNDTRANSACTIONID, FEEREFUNDAMT, etc. As such, I know that those values will be included in $PayPalResult['REFUNDTRANSACTIONID'] and $PayPalResult['FEEREFUNDAMT'] respectively.
- If errors occur they will be available in $PayPalResult['ERRORS']
You may refer to this `overview video <http://www.angelleye.com/overview-of-php-class-library-for-paypal/>`_ of how to use the library,
and there are also samples provided in the /samples directory as well as blank templates ready to use under /templates.
You may `contact me directly <http://www.angelleye.com/contact-us/>`_ if you need additional help getting started. I offer 30 min of free training for using this library,
which is generally plenty to get you up-and-running.
For some reason, though, when you look at that on GitHub the first line of the bullet lists is coming up bold and italics and I have no idea why. Also, the sub-list where it shows Session Variables, General Variables, etc. is supposed to be all the same sub-list. I'm not sure why it's dropping into another sub when it sees General Variables.
Any information on what I've done wrong here would be greatly appreciated. Thanks!
Switch from .rst to .md and then use '#' for your headings.
## Usage
- Open the template file that corresponds to the API call you'd like to make.
* Example